<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragment::head(~{::title})">
    <meta charset="UTF-8">
    <meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
    <title>CodeMan丶|享受生活,享受编程</title>
    <link href="../static/css/semantic.min.css" rel="stylesheet">
    <link href="../static/css/style.css" rel="stylesheet">
</head>
<body>
<!--导航 -->
<nav th:replace="_fragment::menu(0)" class="ui inverted attached segment m-padding-tb-mini m-shadow-small" style="border: none!important;">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">我的博客</h2>
            <a href="#" class="m-item item m-mobile-hide"><i class="home mini icon"></i>首页</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="idea mini icon"></i>分类</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="tags mini icon"></i>标签</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="clone mini icon"></i>归档</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="info mini icon"></i>关于我</a>
            <div class="right m-item item m-mobile-hide">
                <div class="ui transparent inverted icon input">
                    <input type="text" placeholder="Search...">
                    <i class="search link icon"></i>
                </div>
            </div>
        </div>
    </div>
    <div class="ui menu toggle black icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </div>
</nav>
<!--Bar动画  -->
<div id="mybar" style="height: 300px;width: 100%">
    <canvas id=q style="width: 100%;height: 100%"></canvas>
</div>
<!-- 中间内容 -->
<div class="m-padding-tb-small m-container-height">
    <div class="ui m-container ">
        <div class="ui segment m-title-margin">
            <i class="volume up icon red"></i>
            <span style="color:red;">新增留言功能，欢迎大家留言</span>
        </div>
        <div class="ui stackable grid">
            <!-- 左边博客列表 -->
            <div class="eleven wide column">
                <!--header -->
                <div class="ui top attached segment">
                    <div class="ui middle aligned two column grid">
                        <div class="column">
                            <h3 class="ui teal header">博客</h3>
                        </div>
                        <div class="column right aligned">
                            共 <h3 class="ui orange header m-inline-block" th:text="${page.content.size()}">13</h3> 篇
                        </div>
                    </div>
                </div>
                <!--content -->
                <div class="ui attached segment">
                    <div class="ui m-padding-lr-big vertical segment m-padding-tb-small" th:each="blog:${page.content}">
                        <div class="ui mobile reversed stackable grid">
                            <div class="eleven wide column">
                                <h3 class="ui header m-padding-bottom-small">
                                    <a href="" target="_blank" class="m-black" th:href="@{/blog/{id}(id=${blog.id})}" th:text="${blog.title}"> 你知道什么是真的帅吗？</a>
                                </h3>
                                <p class="m-text m-blog-body" th:text="${blog.content}">　从2011年的10月份开始，LZ已经走过了差不多7年多的职业生涯，回想起来，真的有种恍如隔世的感觉。
                                    　　随着年龄越来越大，LZ的文章产出也越来越少，除了偶尔写写小说以外，其它文章基本上很少产出了。
                                    　　尤其是技术方面的文章，LZ已经基本停产了。</p>
                                <div class="ui grid ">
                                    <div class="eleven wide column">
                                        <div class="ui horizontal link list">
                                            <div class="item">
                                                <img th:src="${blog.user.avatar}" src="../static/images/girl.jpeg" alt="" class="ui avatar image">
                                                <div class="content"><a href="#" class="header" th:text="${blog.user.nickname}">彭阳宴</a></div>
                                            </div>
                                            <div class="item" th:text="${#strings.arraySplit(blog.updateTime,' ')[0]}">
                                                <i class="calendar icon"></i> 2020-03-09
                                            </div>
                                            <div class="item">
                                                <i class="eye icon"></i> <span th:text="${blog.views}">200</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="right aligned five wide column">
                                        <a href="#" class="ui teal basic label m-padding-mini" th:text="${blog.type.name}">认知升级</a>
                                    </div>
                                </div>
                            </div>
                            <div class="five wide column">
                                <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                                    <img th:src="${blog.firstPicture}" src="../static/images/girl.jpeg" alt="" class="ui rounded image" style="width: 800px;height: 188px;">
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
                <!--footer -->
                <div class="ui bottom attached segment">
                    <div class="ui middle aligned two column grid">
                        <div class="column">
                            <a href="#" th:href="@{/(page=${page.number - 1})}" th:unless="${page.first}" class="ui mini basic teal button">上一页</a>
                        </div>
                        <div class="column right aligned">
                            <a href="#" th:href="@{/(page=${page.number + 1})}" th:unless="${page.last}" class="ui mini basic teal button">下一页</a>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 右边top -->
            <div class="five wide column">
                <!--  分类 -->
                <div class="ui segments">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column">
                                <i class="idea teal icon"></i>
                                <span class="m-title-style" style="color: teal;">分类</span>
                            </div>
                            <div class="right aligned column">
                                <a href="#" th:href="@{/types/-1}" target="_blank">more <i class="angle double right icon"></i> </a>
                            </div>
                        </div>
                    </div>
                    <div class="ui teal segment">
                        <div class="ui fluid vertical menu">
                            <a href="#" th:href="@{/types/{id}(id=${type.id})}" class="item" th:each="type:${types}">
                                <span th:text="${type.name}">学习日志</span>
                                <div class="ui teal basic left pointing label" th:text="${#arrays.length(type.blogs)}">13</div>
                            </a>
                        </div>
                    </div>
                </div>

                <!-- 标签 -->
                <div class="ui segments m-margin-top-small ">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column">
                                <i class="tags teal icon"></i>
                                <span class="m-title-style" style="color: teal;">标签</span>
                            </div>
                            <div class="right aligned column">
                                <a href="#" th:href="@{/tags/-1}" target="_blank">more <i class="angle double right icon"></i> </a>
                            </div>
                        </div>
                    </div>
                    <div class="ui teal segment">
                        <a th:each="tag:${tags}" href="#" th:href="@{/tags/{id}(id=${tag.id})}" class="ui teal basic left pointing label m-margin-tp-small" >
                            <span th:text="${tag.name}">方法论</span>
                            <div class="detail" th:text="${#arrays.length(tag.blogs)}">23</div></a>
                    </div>
                </div>

                <!-- 最新推荐-->
                <div class="ui segments m-margin-top-small">
                    <div class="ui secondary segment">
                       <i class="thumbs up red icon"></i>
                        <span class="m-title-style" style="color: red">最新推荐</span>
                     </div>
                    <div class="ui segment" th:each="blog:${blogs}">
                        <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" class="m-black m-text-thin" th:text="${blog.title}"> 莫西西 </a>
                    </div>
                </div>

                <!-- 二维码 -->
                <div class="ui horizontal divider header m-margin-top-small"> 扫码关注我 </div>
                <div class="ui centered card" style="width: 11em;height: 11em;">
                    <img src="../static/images/qr.jpg" th:src="${user.wechatQRCode}" alt="" class="ui rounded images" style="height: 100%;">
                </div>

            </div>
        </div>
    </div>
</div>
<br>


<!-- 底部footer -->
<footer th:replace="_fragment::footer" class="ui inverted vertical segment m-margin-top-small">
    <div class="ui center aligned container">
        <div class="ui stackable inverted divided grid m-padding-tb-big">
            <div class="three wide column">
                <div class="ui item">
                    <img src="../static/images/girl.jpeg" alt="" class="ui rounded image m-inline-block" style="width: 100px;">
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">最新博客</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">用户故事{ user story }</a>
                    <a href="#" class="item">用户故事{ user story }</a>
                    <a href="#" class="item">用户故事{ user story }</a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">最新博客</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">用户故事{ user story }</a>
                    <a href="#" class="item">用户故事{ user story }</a>
                    <a href="#" class="item">用户故事{ user story }</a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">最新博客</h4>
                <p class="m-text-thin m-text-spaced m-opacity-mini">xxxxxxxxxxxxxxxxxxxxxxxxxx</p>
            </div>
        </div>
        <div class="ui inverted selection divider"></div>
        <p class="m-text-thin m-text-spaced m-opacity-tiny">Copyright © 2020 - 2021 Mr.Peng</p>
    </div>
</footer>

<!--/*/<th:block th:replace="_fragment::script">/*/-->
    <script src="../static/js/jquery.min.js"></script>
    <script src="../static/js/semantic.min.js"></script>
<!--/*/</th:block>/*/-->

<script>
    $('.menu.toggle').click(function () {
      $('.m-item').toggleClass('m-mobile-hide')
    })
    const s = document.getElementById("mybar");
    const w = (q.width = s.clientWidth);
    const h = (q.height = s.clientHeight);
    const ctx = q.getContext("2d");

    const p = Array(Math.floor(w / 10) + 1).fill(0);

    const random = (items) => items[Math.floor(Math.random() * items.length)];

    const hex = "0123456789ABCDEF".split("");

    setInterval(() => {
        ctx.fillStyle = "rgba(0,0,0,.05)";
        ctx.fillRect(0, 0, w, h);
        ctx.fillStyle = "#00b5ad";
        p.map((v, i) => {
            ctx.fillText(random(hex), i * 10, v);
            p[i] = v >= h || v > 50 + 10000 * Math.random() ? 0 : v + 10;
        });
    }, 1000 / 30);

</script>
</body>
</html>